﻿@using MySoftWare.BaseModel;
@model List<MenuModel>

<div class="menu">
	<ul>
        @{
            ///先获取根菜单列表
            var MenuList = from Menu in Model
                           where Menu.MenuParent == -1
                           orderby Menu.MenuID
                           select Menu;
            foreach (var Single in MenuList)
            {
                var MainMenuUrl = Single.MenuUrl + "?MenuID=" + Single.MenuID;
                <li><a class="current" href="@MainMenuUrl" dataid="@Single.MenuID">@Single.MenuName</a>
                    <ul>
                    @{
                        var ChildList = from Child in Model
                                        where Child.MenuParent == Single.MenuID
                                        orderby Child.MenuID
                                        select Child;
                        foreach(var ChildMenu in ChildList)
                        {
                            var MenuUrl = ChildMenu.MenuUrl + "?MenuID=" + ChildMenu.MenuID;
                            <li><a href="@MenuUrl" title="">@ChildMenu.MenuName</a></li>
                        }   
                     }
                    </ul>
                </li>
            }
        }
	</ul>
</div>
@*        <li><a class="current" href="">Admin Home</a></li>
		<li><a class="current" href="">系统</a>
            <ul>
                <li><a href="" title="">修改密码</a> </li>
                <li><a href="" title="">用户注销</a> </li>
            </ul>
        </li>
*@

